package com.example.sunyueproject;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

import android.hardware.Camera;
import android.hardware.Camera.PreviewCallback;

public class FrameCollector implements PreviewCallback {
	private static FileOutputStream out; 
	
	public FrameCollector() {
		try {
			out = new FileOutputStream(new File("/sdcard/myfile.raw"));
		} catch (FileNotFoundException e) {
			
		}
	}
	
	public void onPreviewFrame(byte[] data, Camera camera) {
		try {
			out.write(data);
		} catch (IOException e) {	}
	}
}
